package org.ssm.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.ssm.dao.IUserDao;
import org.ssm.pojo.User;
import org.ssm.pojo.UserFind;
import org.ssm.service.IUserService;

import java.util.List;
@Service
public class UserService implements IUserService {
    @Autowired
    private IUserDao userDao;
    @Override
    public List<User> findAll() {
        return userDao.findAllUser();
    }

    @Override
    public User findOne(Integer id) {
        return userDao.findOneUser(id);
    }

    @Override
    public void deleteUser(Integer id) {
        userDao.deleteUser(id);
    }

    @Override
    public void insertUser(User user) {
        userDao.insertUser(user);
    }

    @Override
    public void updateUser(User user) {
        userDao.updateUser(user);
    }

    @Override
    public List<User> findBySome(UserFind userFind) {
        return userDao.selectByCondition(userFind);
    }


    public void setUserDao(IUserDao userDao) {
        this.userDao = userDao;
    }
}
